package com.stylefeng.guns.modular.pay.service.impl;

import com.stylefeng.guns.modular.pay.model.MchBus;
import com.stylefeng.guns.modular.pay.model.Trans;
import com.stylefeng.guns.modular.pay.dao.MchBusMapper;
import com.stylefeng.guns.modular.pay.service.IMchBusService;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 佳付通商户开通业务 服务实现类
 * </p>
 *
 * @author stylefeng
 * @since 2018-08-17
 */
@Service
public class MchBusServiceImpl extends ServiceImpl<MchBusMapper, MchBus> implements IMchBusService {
	@Autowired
	private MchBusMapper mchBusMapper;
	
	@Override
	public MchBus findBychMerCode(String chMerCode) {
		MchBus bus = new MchBus();
		bus.setChMerCode(chMerCode);
		return mchBusMapper.selectOne(bus);
	}

	@Override
	public void update(Integer id, int statuss, String resCode, String resMsg) {
		MchBus bus = new MchBus();
		bus.setId(id);
		bus.setStatus(statuss);
		bus.setResCode(resCode);
		bus.setResMsg(resMsg);
		mchBusMapper.updateById(bus);
		
	}

	@Override
	public List<MchBus> list(Page<MchBus> page, MchBus params) {
		return mchBusMapper.list(page,params);
	}

}
